/*
 * execStruct.h
 *
 *  Created on: Apr 25, 2011
 *      Author: tflanzer
 */
#include <string.h>
#include <stdio.h>
#include <map>
#ifndef EXECSTRUCT_H_
#define EXECSTRUCT_H_

struct aupData {
	double GPStime,GPS_VN, GPS_VE, GPS_VD, GPS_N, GPS_E, GPS_D, lat, lon, fix, numSats;
	double ax1,ay1,az1,p,q,r,diffpress,barotemp,ax2,ay2,az2,mx,my,mz,baropress,sonar_range;
	unsigned char throttle,aileron,elevator,rudder,autoFlag; // Measured servo pulse widths
};

struct controlVector {
	double ailDefRad,eleDefRad,rudDefRad,thrPercent;
};

struct stateVector {
	double Np, Ep, Dp;
	double p, q, r;
	double VNi, VEi, VDi;
	double q0, q1, q2, q3; // Attitude quaternions
	double phi, theta, psi; // Euler angles
};

struct paramVector {
    double VNi_wind, VEi_wind;                      // Winds
    double wbx, wby, wbz, diffb, barob; // Sensor biases
    double abx, aby, abz;
	double waypointNorth[50];
	double waypointEast[50];
	double waypointAlt[50];
	double waypointVel[50];
	int wpidx[2], numwps;
	double initLat, initLon;
	double Vtarget;
	bool killMariner;
};

struct controlGains {
	std::map <std::string,double> cmap;
	char gainName[200][10];
	int numgains;
};

extern struct aupData apdat;
extern struct controlVector cv;
extern struct stateVector sv;
extern struct paramVector pv;
extern struct controlGains ctrlGns;

#endif /* EXECSTRUCT_H_ */
